<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // console.log(null instanceof Object);

        // var person = {
        //     name:'zhangsan',
        //     age:18
        // }
        // console.log(person);

        // 任何对象都属于一个类型
        // 任何对象都有一个所属构造函数  
        // 判断所属构造函数是谁 可以判断数据类型  

    //    function Person(){

    //    }

    //    var p1 = new Person();
    //    console.log(p1.constructor); // Person   
    //    console.log([].constructor); // Array    
    //    console.log((function(){}).constructor);//Function
    //    console.log(/^\d$/.constructor);// RegExp
    //    console.log(undefined.constructor);// 报错
    //    console.log(null.constructor);
    

    console.log(Object.prototype.toString.call({})); // [object Object]
    console.log(Object.prototype.toString.call([]));// [object Array]
    console.log(Object.prototype.toString.call(123)); //[object Number]
    console.log(Object.prototype.toString.call('hello world')); //  [object String]
    console.log(Object.prototype.toString.call(true)); // [object Boolean]
    console.log(Object.prototype.toString.call(function(){}));// [object Function]
    console.log(Object.prototype.toString.call(undefined));// [object Undefined]
    console.log(Object.prototype.toString.call(null)); // [object Null]
    console.log(Object.prototype.toString.call(new Date()));// [object Date]
    console.log(Object.prototype.toString.call(/\d/)); // [object RegExp]

    console.log(Object.prototype.toString.call({}) === '[object Object]'); // [object Math]




    </script>
</body>
</html>